int calPoints(char ** ops, int opsSize){
    int records[1000], top = 0;

    for (int i = 0; i < opsSize; i += 1){
        switch (ops[i][0]){
        case '+':
            records[top] = records[top - 1] + records[top - 2];
            top += 1;

            break;
        case 'D':
            records[top] = records[top - 1] * 2;
            top += 1;

            break;
        case 'C':
            top -= 1;

            break;
        default:
            records[top] = atoi(ops[i]);
            top += 1;
        }
    }

    int total = 0;
    for (int i = 0; i < top; i += 1){
        total += records[i];
    }

    return total;
}